﻿@using PAMD.Business.Models
@model ResetPasswordModel
@{
    ViewBag.Title = SiteConstant.Slogan;
    Layout = "../Shared/_Layout.cshtml";
}
<script type="text/javascript" language="javascript">

    $(document).ready(function (event) {

        $('#SaveButton').click(function () {

            var validated = ValidateForm();
            return validated;
        });

    });

</script>
@using(Html.BeginForm("RecoverPassword", "Account"))
{
<div class="form-container-small">
    <strong>Sign In</strong>
    <fieldset class="field-container">
        @if (!ViewData.ModelState.IsValid)
        {
            <div class="error-box">
                We could not find you in our database. You may have already reset password using
                this link, Please try @Html.ActionLink("Login", "Login", "Account")&nbsp;to your
                account.
            </div>
        }
        <br />
        <div class="left-align">
            <div class="controlBox">
                <label for="Password" style="width: 400px;">
                    E-Mail address:&nbsp;<b>@Model.Email </b>@Html.HiddenFor(m => m.ResetKey)
                </label>
            </div>
        </div>
        <div class="left-align">
            <div class="controlBox">
                <label for="Password" style="width: 200px;">
                    New password &nbsp;</label>
                @Html.PasswordFor(m => m.Password, new { validation = "required,match,minmaxLenght,4,25", @class = "inputBox" })
            </div>
            <div id="Password_Error" class="error-box">
                Please enter password, Min 4 character.
            </div>
        </div>
        <div class="left-align">
            <div class="controlBox">
                <label for="Password2" style="width: 200px;">
                    Confirm password &nbsp;</label>
                @Html.Password("Password2", string.Empty, new { @class = "inputBox" })
            </div>
            <div id="Password_Match" class="error-box">
                Password does not match the confirm password.
            </div>
        </div>
         <div class="left-align">
           <div class="controlBox">
                    <input type="submit" id="SaveButton" style="margin-left: 200px;" value="Reset Password" />
            </div>
        </div>
    </fieldset>
</div>
}